/**
 * Clase que representa la estructura de la tabla en un objeto Java. Cada
 * atributo de la tabla es creado como variables y su formato como anotaciones
 *
 * @version 1.0, 25/04/12
 * @author emojica
 */
package request.autocomplete;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

@ManagedBean(name = "request_autocompleteBeans")
@ViewScoped
public class Beans {

    public request.general.Beans requestBeans = new request.general.Beans();
    public university.general.Beans universityBeans = new university.general.Beans();
    public university.faculty.Beans facultyBeans = new university.faculty.Beans();
    public university.location.Beans sedeBeans = new university.location.Beans();
    public person.general.Beans personBeans = new person.general.Beans();

    public Beans() {
    }

    public Beans(Integer id_solicitud, String carrera, String universidad, String accion, String facultad, String persona) {
        this.requestBeans.setId(id_solicitud);
        this.requestBeans.setCarrera("(" + accion + ") " + carrera);
        this.universityBeans.setNombre(universidad);
        this.facultyBeans.setNombre(facultad);
        this.personBeans.setNombre(persona);
    }

    /**
     * Método que permite inicializar todas las variables
     */
    public void clearBeans() {

        this.getUniversityBeans().clearBeans();
        this.getFacultyBeans().clearBeans();
        this.getPersonBeans().clearBeans();
    }

    private String strScape(String data) {
        data = data.trim();
        data = data.replace("'", "''");
        data = data.replace("\\", "\\\\");
        return data;
    }

    /**
     * @return the universityBeans
     */
    public university.general.Beans getUniversityBeans() {
        return universityBeans;
    }

    /**
     * @return the facultyBeans
     */
    public university.faculty.Beans getFacultyBeans() {
        return facultyBeans;
    }

    /**
     * @return the personBeans
     */
    public person.general.Beans getPersonBeans() {
        return personBeans;
    }

    /**
     * @return the sedeBeans
     */
    public university.location.Beans getSedeBeans() {
        return sedeBeans;
    }

    /**
     * @return the curriculumBeans
     */
    public request.general.Beans getRequestBeans() {
        return requestBeans;
    }

    public void setRequestBeans(request.general.Beans requestBeans) {
        this.requestBeans = requestBeans;
    }

    public void setUniversityBeans(university.general.Beans universityBeans) {
        this.universityBeans = universityBeans;
    }

    public void setFacultyBeans(university.faculty.Beans facultyBeans) {
        this.facultyBeans = facultyBeans;
    }

    public void setSedeBeans(university.location.Beans sedeBeans) {
        this.sedeBeans = sedeBeans;
    }

    public void setPersonBeans(person.general.Beans personBeans) {
        this.personBeans = personBeans;
    }
}